<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
<div id="app11">
    {{msg}}
</div>
<script type="text/javascript">
    /*
    * 生命周期钩子演示：
    * 生命周期钩子定义成一个属性，值是一个函数
    * */
    var vm = new Vue({
        el: '#app11',
        data: {msg: 'hello'},
        beforeCreate: function () {
            console.log('beforeCreate');
        },
        created: function () {
            console.log('created');
        },
        beforeMount: function () {
            console.log('beforeMount');
        },
        mounted: function () {
            console.log('mounted');
        },
        beforeUpdate: function () {
            console.log('beforeUpdate');
        },
        updated: function () {
            console.log('updated');
        },
    });

    /*
    * 三秒钟之后改变文本
    * */
    setTimeout(function () {
        vm.msg = 'change...'
    }, 3000);

</script>
</body>
</html>